home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 2
/
002.d81
/
address keeper
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
11KB
|
397 lines
10 rem
20 rem address keeper by donna k. woody
30 :
40 poke53272,23:rem selects upper/lower case
50 printchr$(8):rem disables c/shift keys
60 poke53280,5:rem set border color to green
70 poke53281,1:rem set background color to white
80 printchr$(30):rem set character color to green
90 :
100 rem initialize variables
110 :
120 gosub3800:goto210
130 :
140 rem most used subroutines
150 :
160 poke204,0:poke207,0:getz$:return
170 printtab(16+len(q$)+1)"[145][145]";:fork=len(q$)+1tobc:printchr$(32);:next:return
180 :
190 rem title, instructions & main menu
200 :
210 printchr$(147):printtab(6)a1$
220 print:print:printtab(12)"0. [197]xit program"
230 print:printtab(12)"1. [201]nstructions"
240 print:printtab(12)"2. [197]nter names"
250 print:printtab(12)"3. [195]hange/[193]dd names"
260 print:printtab(12)"4. [208]rint names"
270 print:print:print
280 print"[197]nter selection [0 - 4]: ";
290 gosub160:ifz$=""then290
300 poke204,1:print
310 z=val(z$):ifz=0thenifz$="0"then390
315 ifz=0then200
320 t=1
330 ifz>4thenzz=6:zy=15:gosub2470:goto280
340 onzgosub2220,430,1700,1860
350 forx=1to100:name$(x)="":adr$(x)="":city$(x)="":state$(x)="":zip$(x)=""
360 ph$(x)="":next
370 flag=0
380 goto210
390 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
395 poke631,13:poke632,13:poke198,2:end
400 :
410 rem input routine
420 :
430 forx=tto100
440 printchr$(147):printtab(6)a1$
450 print"[213]sing this option with create a new"
460 print"[193][196][196][210][197][211][211] [198][201][204][197]. [201]f you have an existing"
470 print"file that you want to add to, return to"
480 print"the [205]ain [205]enu and take the [195]hange/[193]dd "
490 print"option."
500 print"[196]o you want to continue with this option(y/n)? ";
510 gosub160:ifz$=""then510
520 poke204,1:print:ifz$="n"orz$="[206]"thenreturn
530 forx=tto100
540 flag=0
550 printchr$(147):printtab(6)a1$
560 print"[197]nter <[209]> to end entry."
570 print"[206]ame:";:gosub2510:printtab(16)"[145]";:bc=22:gosub2570:name$(x)=q$
580 ifflag=1thenflag=0:cc=x-1:x=100:goto680
590 print"[211]treet address:";:gosub2510:printtab(16)"[145]";
600 bc=22:gosub2570:adr$(x)=q$
610 print"[195]ity:";:gosub2510:printtab(16)"[145]";:bc=22:gosub2570:city$(x)=q$
620 print"[211]tate:";:gosub2520:printtab(16)"[145]";:bc=3:gosub3320:zz=11:zy=9
630 gosub3210:ifflag=0thenprint:goto620
640 state$(x)=q$
650 print"";:fork=1to29:printchr$(32);:next:print"[145][145][145][145][145][145][145][145][145][145][145][145]"
660 print"[218]ip code:";:gosub2530:printtab(16)"[145]";:bc=6:gosub2820:zip$(x)=q$
670 print"[208]hone number:";:gosub2540:printtab(16)"[145]";:bc=13:gosub3000:ph$(x)=q$
680 next
690 printchr$(147):printtab(6)a1$
700 print"[206]ow ready to check names and addresses"
710 print"for errors before writing them to disk."
720 print""a2$;
730 gosub160:ifz$=""then730
740 poke204,1:print
750 :
760 rem check for typos & change
770 :
780 forx=1tocc
790 printchr$(147):printtab(6)a1$
800 print"[206]ame:";:gosub2510:printtab(16)"[145]"name$(x)
810 print"[193]ddress:";:gosub2510:printtab(16)"[145]"adr$(x)
820 print"[195]ity:";:gosub2510:printtab(16)"[145]"city$(x)
830 print"[211]tate:";:gosub2520:printtab(16)"[145]"state$(x)
840 print"[218]ip code:";:gosub2530:printtab(16)"[145]"zip$(x)
850 print"[208]hone number:";:gosub2540:printtab(16)"[145]"ph$(x)
860 print"[201]ndicate item to change:"
870 print" <[206]>ame, <[193]>ddress, <[195]>ity, <[211]>tate,"
880 print" <[218]>ip, <[208]>hone number, <[199]>et next"
890 :print"[197]nter letter: ";
900 gosub160:ifz$=""then900
910 poke204,1:print"[146] "
920 print"";:fork=1to29:printchr$(32);:next:print"[145][145][145][145][145][145]"
930 ifz$="[206]"orz$="n"then1010
940 ifz$="a"orz$="[193]"then1040
950 ifz$="c"orz$="[195]"then1070
960 ifz$="[211]"orz$="s"then1100
970 ifz$="[218]"orz$="z"then1150
980 ifz$="p"orz$="[208]"then1170
990 ifz$="g"orz$="[199]"then1190
1000 zz=5:zy=13:gosub2470;:goto860
1010 printchr$(19)"";tab(16);:bc=22:gosub2570:name$(x)=q$
1020 gosub170
1030 print"":goto860
1040 printchr$(19)"";tab(16);:bc=22:gosub2570:adr$(x)=q$
1050 gosub170
1060 print"":goto860
1070 printchr$(19)"";tab(16);:bc=22:gosub2570:city$(x)=q$
1080 gosub170
1090 print"":goto860
1100 printchr$(19)"";tab(16);:bc=3:gosub3320:zz=13:zy=7:gosub3210
1110 ifflag=0thenprint:goto1100
1120 state$(x)=q$
1130 print"";:fork=1to29:printchr$(32);:next:print"[145][145][145][145][145][145][145][145][145][145][145][145]"
1140 print:goto860
1150 printchr$(19)"";tab(16);:bc=6:gosub2820:zip$(x)=q$
1160 print:goto860
1170 printchr$(19)"";tab(16);:bc=13:gosub3000:ph$=q$
1180 print"[145][145]":goto860
1190 next
1200 printchr$(147):printtab(6)a1$
1210 print"[208]lease have patience with me..."
1220 print"[201] am writing information to the disk."
1230 close15:open15,8,15,"r0:address file=address file":gosub3940:close15
1240 ifcz=62thenclose4:open4,8,4,"0:address file,seq,w":goto1550
1250 ifcz=72then1450
1260 ifcz=63then1290
1270 ifcz>20then1500
1280 goto1200
1290 printchr$(147):printtab(6)a1$
1300 print"[193][196][196][210][197][211][211][160][198][201][204][197] already exists. [201]f you"
1310 print"want to save the changes or entries you"
1320 print"have made, the existing file must be"
1330 print"deleted before the new information can"
1340 print"be saved. [201]f you do not enter 'yes',"
1350 print"you will be sent back to the main menu"
1360 print"and your data will be lost. [217]ou may"
1370 print"put in a new disk and answer 'yes' to"
1380 print"keep both sets of data. [196]o you wish to"
1390 input"save your changes/entries (yes/no) ";z$
1400 ifz$="yes"orz$="[217][197][211]"then 1420
1410 return
1420 close4:open4,8,4,"0:adf.temp,seq,w":gosub1550
1430 print"[208]lease wait...":close15:open15,8,15,"s0:address file":close15
1440 close15:open15,8,15,"r0:address file=adf.temp":close15:return
1450 print"[212]his disk is full."
1460 print"[208]lease place another disk in the drive."
1470 print""a2$;
1480 gosub160:ifz$=""then1480
1490 poke204,1:print"[146] ":goto1200
1500 print"[201] have detected an error in trying to"
1510 print"write to the disk. [212]he error is:"
1520 print""cz,mz$,tz,sz
1530 print"[211]ince this may be an irrecoverable"
1540 print"error, the program is being terminated.":close4:close15:end
1550 print#4,cc
1560 forx=1tocc
1570 print#4,name$(x)
1580 print#4,addr$(x)
1590 print#4,city$(x)
1600 print#4,state$(x)
1610 print#4,zip$(x)
1620 print#4,ph$(x)
1630 next
1640 close4
1650 printchr$(147):printtab(6)a1$
1660 print"[196]ata has been written to the disk.":fork=1to500:next:return
1670 :
1680 remchange names
1690 :
1700 gosub3500
1710 printchr$(147):printtab(6)a1$
1720 print"[217]ou may choose to:"
1730 print" 0. [210]eturn to [205]ain [205]enu"
1740 print" 1. [205]ake [195]hanges"
1750 print" 2. [205]ake [193]dditions"
1760 print"[197]nter selection (0 - 2): ";
1770 gosub160:ifz$=""then1770
1780 poke204,1:print"[146] ":print:z=val(z$)
1790 ifz=0thenreturn
1800 ifz=1thengoto780
1810 ifz=2thent=cc+1:goto530
1820 zz=7:zy=10:gosub2470:goto1760
1830 :
1840 rem print routine
1850 :
1860 gosub3500
1870 printchr$(147):printtab(6)a1$
1880 flag=0
1890 print"[217]ou may print to:"
1900 print" 0. [210]eturn to [205]ain [205]enu"
1910 print" 1. [204]abels"
1920 print" 2. [204]ist"
1930 print"[197]nter selection (0 - 2): ";
1940 gosub160:ifz$=""then1940
1950 poke204,1:print"[146] ":print:z=val(z$)
1960 ifz=0then return
1970 ifz=1thenflag=1:goto 2000
1980 ifz=2thenflag=0:goto2000
1990 zz=6:zy=10:gosub2470:goto1930
2000 printchr$(147):printtab(6)a1$
2010 print"[208]lease make sure printer is on"
2020 print"and paper or labels are lined up.":print""a2$;
2030 gosub160:ifz$=""then2030
2040 poke204,1:print"[146] "
2050 open4,4,7
2060 forx=1tocc
2070 print#4,name$(x)
2080 print#4,adr$(x)
2090 print#4,city$(x);:print#4,",";
2100 print#4,state$(x);:print#4," ";
2110 print#4,zip$(x)
2120 ifflag=0thenprint#4,ph$(x)
2130 ifflag=1thenprint#4:print#4:print#4:goto2160
2140 ifflag=0thenprint#4: